﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FastFoodToNight.Models;
using FastFoodToNight.ViewModels;

namespace FastFoodToNight.Controllers
{
    public class ShopCartController : Controller
    {
      
        //
        // GET: /ShopCart/
        QLFOODContext db = new QLFOODContext();
        

        public ViewResult SanPham()
        {
            shopcart sc = new shopcart();
            var sp = db.SanPhams.ToList();
            sc.SanPham = sp;
            return View(sc);
        }
        
        public ActionResult AddGioHang(int id)
        {
            var addedHang = db.SanPhams.Where(p => p.masanpham == id).ToList();


            // Add it to the shopping cart
            var cart = _ShopCart.GetCart(this.HttpContext);
           
            //cart.AddToCart(addedAlbum);
 

            //shopcart sc = new shopcart();
            //var sanpham =db.SanPhams.Where(p=>p.masanpham==id).ToList();
            //sc.SanPham = sanpham;
            return View();

        }
        public ActionResult EditGioHang(int id)
        {
            return View();
        }
    }
}
